module.exports = function(lab) {
    return {
        @importStoreFromExcel: function(session, request) {
            return lab.snapshot(function(snapshot) {
                return @.async.all(request.file || [], function(storeInfo) {

                    snapshot.slime.store.@importStore(session.currentOU.id, {
                        number: storeInfo.number,
                        name: storeInfo.name,
                        country: storeInfo.country,
                        province: storeInfo.province,
                        city: storeInfo.city,
                        district: storeInfo.district,
                        address: storeInfo.address,
                        latitude: storeInfo.latitude,
                        longitude: storeInfo.longitude,
                        business_hours: storeInfo.business_hours,
                        image_url: storeInfo.image_url,
                        phone: storeInfo.phone,
                        manager_account : storeInfo.manager_account,
                        manager_password : storeInfo.manager_password ? storeInfo.manager_password :  (request.generatePassword && storeInfo.manager_account ? @.uuid(true).substr(0,6) : undefined )
                    }).pipe(this);

                })
            })
        }
    }
}